#!/bin/bash

usage() {
	echo "Usage: bash copy.sh"
	exit 1
}

# 启用 bash 扩展模式匹配，用于支持 rm 命令参数中的排除语法
shopt -s extglob

# copy sql
echo "*** begin copy sql ***"
copytodir=./ruoyi-vue-mysql/sql
rm -rf ${copytodir}/!(.keep)
cp ../sql/*.sql ${copytodir}

# copy ruoyi-admin jar
echo "*** begin copy ruoyi_vue_admin ***"
copytodir=./ruoyi-vue-admin/package
rm -rf ${copytodir}/!(.keep)
cp ../ruoyi-admin/target/ruoyi-admin.jar ${copytodir}

# copy ruoyi-web html
echo "*** begin copy ruoyi-web ***"
copytodir=./ruoyi-vue-ui/package/dist
rm -rf ${copytodir}
mkdir ${copytodir}
cp -r ../ruoyi-ui/dist/** ${copytodir}
